<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<%@ page import="com.scalar.chiptrack.utils.ConfigManager" %>

<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/chiptrack-tags.tld" prefix="chiptrack" %>

<chiptrack:checkLogon sourcePage="/wipSummary.do?reporttype=wipVsBackLogPlanReport"/>

<%String chipTracContext = "/" + ConfigManager.getChipTracContext();%> <%-- try { --%>

<HTML>
<HEAD><TITLE>Scalarsoft - ChipTrac</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<LINK href="<%=chipTracContext%>/jsp/includes/stylesheets/scalarsoft.css" type="text/css" rel="stylesheet">
<script src="<%=chipTracContext%>/jsp/includes/scripts/functions.js"></script>
<script src="<%=chipTracContext%>/jsp/includes/scripts/validations.js"></script>
<script src="<%=chipTracContext%>/jsp/includes/scripts/quickSearch.js"></script>
</HEAD>
<script language="javascript">

function loadProductsbyParentId()
{
    document.wipInventoryForm.action="<%=chipTracContext%>/wipSummary.do?reporttype=wipVsBackLogPlanReport";
    document.wipInventoryForm.submit();
}

function submitReport()
{
    var success = true;
    success = validateFromAndToDates();
    if(success == false)
    {
       return;
    }
    document.wipInventoryForm.action = "<%=chipTracContext%>/wipSummary.do?action=xlsWipVsBackLogPlanReport"
    document.wipInventoryForm.submit();

}

var dateElement = "";
function openCalendar(dateValue)
{
    dateElement = dateValue;
    newWindow = window.open('<%=chipTracContext%>/jsp/includes/calendar.html','optionsPopup','channelmode=no,directories=no,toolbar=no,menubar=no,personalbar=no,status=no,scrollbars=no,width=180,height=440,resizable=no');
    newWindow.moveTo(550,180);
    newWindow.focus();
}
function assignDate(passedValue)
{
    dateElement.value=passedValue;
    window.focus();
}
function validateFromAndToDates()
{
    var formdoc = document.wipInventoryForm;
    errMsg = '';

    var pa	= document.getElementById("errors");

    if(chkDate(formdoc.fromDate.value,'From-Date','N') == false)
    {
        pa.innerHTML = errMsg;
        formdoc.fromDate.focus();
        return false;
    }

    if(chkDate(formdoc.toDate.value,'To-Date','N') == false)
    {
        pa.innerHTML = errMsg;
        formdoc.toDate.focus();
        return false;
    }

    if(formdoc.fromDate.value!='' && formdoc.toDate.value!='')
    {
        if (!validateDateOut(formatDateAsMMDDYYYY(formdoc.fromDate.value),formatDateAsMMDDYYYY(formdoc.toDate.value)))
        {
            pa.innerHTML = "<li>To Date cannot be less than From Date</li>";
            formdoc.toDate.focus();
            return false;
        }
    }
    return true;
}

</script>
<BODY bgColor=#ffffff leftMargin=0 topMargin=0 marginheight="0" marginwidth="0" >
<!-- Top Header Start-->
<%@ include file="/jsp/includes/header.jsp" %>
<!-- Top Header End-->
<TABLE cellSpacing="0" cellPadding="0" width="100%" border="0">
  <TR>
	<TD width='180' valign='top' background='<%=chipTracContext%>/jsp/includes/images/left_red_bg.gif'>
    <!-- Side Navigation start -->
    <%@ include file="/jsp/operations/reports_side_menu.jsp" %>
    <!-- end of the side navigations -->
    </TD>
    <TD bgcolor="#ffffff">
        <IMG height="9" src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width="8"></TD>
        <TD bgcolor="#ffffff"><IMG height=480 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width="2"></TD>
        <TD valign="top" width="100%">
        <IMG height="1" src="<%=chipTracContext%>/jsp/includes/images/clear.gif" width="500" border="0">
        <BR>
        <html:form name="wipInventoryForm" type="com.scalar.chiptrack.operations.reports.forms.WipInventoryForm" action="/wipSummary.do?reporttype=wipVsBackLogPlanReport">
        <TABLE border="0" width="100%" align="center">
            <TR><TD colspan="6" class="NArialW" align="center">WIP Vs Backlog Report</TD></TR>

            <TR><TD colspan="6">&nbsp;</TD></TR>
            <TR><TD width="12%" >&nbsp;</TD><TD colspan="6" class='NArialL' align="left"><strong><FONT id="message" styleClass="NArialL" color='FF0000'>&nbsp;</FONT></strong></TD></TR>
            <TR>
                <TD>&nbsp;</TD>
                <TD colspan="6" align="left">
                  <chiptrack:info styleClass="NArialL" />
                  <chiptrack:errors styleClass="NArialL" />
                  <chiptrack:messages type="info" styleClass="NArialL" />&nbsp;
                </TD>
            </TR>
            <TR>
                <TD colspan="6">
                    <TABLE align="center" border="0" width="100%" cellspacing="3" cellpadding="2">
                        <TR>
                            <TD width="10%" >&nbsp;</TD>
                            <TD width="15%" class="NArialL" valign = 'top' align = "left">Base Product </TD>
                            <TD width="20%" class="NArialL" valign = 'top'>
                                <html:select property="productId" name="wipInventoryForm" styleClass="txfield" onchange="loadProductsbyParentId()">
                                    <html:option value="0">All BaseProducts</html:option>
                                    <html:options collection="baseProductList" property="value" labelProperty="label"/>
                                </html:select>
                            </TD>
                            <TD width="15%" class="NArialL" valign = 'top' align = "left" nowrap="true">&nbsp;&nbsp;<bean:message key="label.mktgPartNumber" /></TD>
                            <TD width="20%" class="NArialL" valign = 'top'>
                                <html:select property="processstepId" name="wipInventoryForm" styleClass="txfield">
                                    <html:option value="0">All Part Numbers</html:option>
                                    <html:options collection="mktPartNumberList" property="value" labelProperty="label"/>
                                </html:select>
                            <TD width="15%">&nbsp;</TD>
                         </TR>

                        <TR><TD colspan="6"><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=10></TD></TR>
                        <TR>
                            <TD width="10%">&nbsp;</TD>
                            <TD width="15%" class="NArialL" valign="top" nowrap="true">ChipSet</TD>
                            <TD width="20%" class="NArialL" valign="top" nowrap="true">
                                <html:select property="chipSet" name="wipInventoryForm" styleClass="txfield">
                                    <html:option value="All">All ChipSet</html:option>
                                    <html:options collection="chipSetList" property="value" labelProperty="label"/>
                                </html:select>
                            </TD>
                            <TD width="15%" class="NArialL" valign="top" align = "left">&nbsp;</TD>
                            <TD width="20%" class="NArialL" valign="top"> &nbsp;</TD>
                            <TD width="15%">&nbsp;</TD>
                        </TR>

                        <TR>
                            <TD width="10%">&nbsp;</TD>
                            <TD width="15%" class=NArialL style="width:100px">From-Date</TD>
                            <TD width="20%" class=NArialL><font>
                                <html:text property="fromDate" styleClass="txfield" size="16" maxlength="10"/>
                                <a href="javascript:openCalendar(document.wipInventoryForm.fromDate)">
                                <img onMouseOver="window.status='Click here to select From date';return true" onMouseOut="window.status='';return true" border="0" align='center' title="Click here to Select From Date"
                                src="<%=chipTracContext%>/jsp/includes/images/date_selector.gif" height=20 width=20></a>
                            </TD>

                            <TD width="15%" class=NArialL style="width:100px">To-Date</TD>
                            <TD width="20%" class=NArialL>
                                <html:text property="toDate" styleClass="txfield" size="16" maxlength="10"/>
                                <a href="javascript:openCalendar(document.wipInventoryForm.toDate)">
                                <img onMouseOver="window.status='Click here to select To date';return true" onMouseOut="window.status='';return true" border="0" align='center' title="Click here to Select To Date"
                                src="<%=chipTracContext%>/jsp/includes/images/date_selector.gif" height=20 width=20></a>
                            </TD>
                            <TD width="15%">&nbsp;</TD>
                        </TR>
                        <TR><TD colspan="6"><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=10></TD></TR>
                        <TR><TD colspan="6"><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=10></TD></TR>
                       <TR>
                            <TD colspan="4" align=right valign="top">
                                <a href="javascript:submitReport();"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/submit.gif" width="53" height="17" onmouseover="window.status='Click to Generate WIP Vs Backlog Planning Report';return true" onmouseout="window.status='';return true" title='Click to Generate WIP Vs Backlog Planning Report'></a>
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                <a href="javascript:document.wipInventoryForm.reset();"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/reset.gif" width="53" height="17" onmouseover="window.status='Click to reset search';return true" onmouseout="window.status='';return true" title="Click here to reset search"></a>
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            </TD>
                            <td colspan=2 valign="top">&nbsp;</td>
                       </TR>
                        <TR><TD colspan="6"><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=10></TD></TR>
                    </TABLE>
                </TD>
            </TR>
        </TABLE>
        </html:form>
    </TR>
</TABLE>
<!-- Footer starts here -->
<%@ include file="/jsp/includes/footer.jsp" %>
<!-- footer end here -->
</BODY>
</HTML>
<%--<% } catch(Exception e){e.printStackTrace();} %>--%>
